<script>
    function getParams(key) {
        let query = window.location.search.substring(1);
        // let query = window.location.href.split('?')[1]
        query = decodeURI(query)
        let vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var tempArr = vars[i].split("=");
            if (tempArr[0] == key) return tempArr[1]
        }
        return false;
    }

    console.log(getParams('uname'))

</script>